package reentrant;

public class UnReentrantLockTest {
    //导致重入锁死
    private final UnReentrantLock lock = new UnReentrantLock();

    public void outer() throws InterruptedException {
        lock.lock();
        inner();
        lock.unlock();
    }

    public void inner() throws InterruptedException {
        lock.lock();
        //do something
        lock.unlock();
    }

    public static void main(String[] args) throws InterruptedException {
        UnReentrantLockTest test = new UnReentrantLockTest();
        test.outer();

        System.out.println("成功");
    }
}
